import Vue from 'vue'
import VueRouter from 'vue-router'
import layoutView from '../views/layout/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../components/login.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: layoutView,
    children: [
      {
        path: '/overView',
        name: 'overView',
        component: () => import( '../views/overView/index.vue')
      },
      {
        path: '/student',
        name: 'student',
        component: () => import( '../views/student/index.vue')
      },
      {
        path: '/teacher',
        name: 'teacher',
        component: () => import( '../views/teacher/index.vue')
      },
      {
        path: '/target',
        name: 'target',
        component: () => import( '../views/target/index.vue')
      },
      {
        path: '/plan',
        name: 'plan',
        component: () => import( '../views/plan/index.vue')
      },
      {
        path: '/post',
        name: 'post',
        component: () => import( '../views/post/index.vue')
      },
      {
        path: '/weekly_log',
        name: 'weekly_log',
        component: () => import( '../views/weekly_log/index.vue')
      },
      {
        path: '/report',
        name: 'report',
        component: () => import( '../views/report/index.vue')
      },
      {
        path: '/identify',
        name: 'identify',
        component: () => import( '../views/identify/index.vue')
      },
      {
        path: '/application',
        name: 'application',
        component: () => import( '../views/application/index.vue')
      },
      {
        path: '/personal',
        name: 'personal',
        component: () => import( '../views/personal/index.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
